# export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
# g++ -g -Wall src/main.c -I/root/share/CVS_CMS/PUBLIC/spdlog/include -L /root/share/CVS_CMS/PUBLIC/spdlog -lspdloginterface --std=c++11 -o main.out

#目标文件
TARGET=libspdloginterface.so
#源文件目录
SCR = src
#编译选项
CPPFLAGS = -g
LNK_SPDLOG = -L/root/share/CVS_CMS/PUBLIC/spdlog/lib -lspdlog -std=c++11 -pthread

VPATH = src:/root/share/CVS_CMS/PUBLIC/spdlog/include
ROOT_DIR := $(shell pwd)

SPEC_INC := -I/root/share/CVS_CMS/PUBLIC/spdlog/include

NOMAL_OBJS := $(ROOT_DIR)/$(SCR)/spdlog_interface.o 
	
$(TARGET):$(NOMAL_OBJS)
	 ld  $(CPPFLAGS) $(NOMAL_OBJS) -o $(TARGET) -shared -fPIC -lc -std=c++11


#依赖头、源文件和公共头
$(NOMAL_OBJS):  %.o : %.cpp %.h
	g++ $(CPPFLAGS) $(SPEC_INC) $(LNK_SPDLOG) -o $@ -c -fPIC $(subst .o,.cpp,$@)

.PHONY: clean 
clean: 
	rm -rf $(TARGET)
	rm -rf $(NOMAL_OBJS)